package com.sj.purchase.modules.cost.domain.order;

import com.sj.purchase.modules.cost.domain.WarehouseEnum;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by icodebug on 17-7-14.
 */
@MappedSuperclass
public abstract class Order {

    @Id
    private String id;

    private String orderNo;//订单编号

    @Enumerated(EnumType.STRING)
    private OrderType type;//类型（销售。。。。。）

    @Enumerated(EnumType.STRING)
    private WarehouseEnum warehouseEnum;//仓库

    @Temporal(TemporalType.TIMESTAMP)
    private Date createDate;

    @Temporal(TemporalType.DATE)//同上面日期一样为了方便查询
    private Date saveDateDay;

    public String getId() {
        return id;
    }

    public Order setId(String id) {
        this.id = id;
        return this;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public Order setOrderNo(String orderNo) {
        this.orderNo = orderNo;
        return this;
    }

    public Date getSaveDateDay() {
        return saveDateDay;
    }

    public Order setSaveDateDay(Date saveDateDay) {
        this.saveDateDay = saveDateDay;
        return this;
    }

    public OrderType getType() {
        return type;
    }

    public Order setType(OrderType type) {
        this.type = type;
        return this;
    }

    public WarehouseEnum getWarehouseEnum() {
        return warehouseEnum;
    }

    public Order setWarehouseEnum(WarehouseEnum warehouseEnum) {
        this.warehouseEnum = warehouseEnum;
        return this;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public Order setCreateDate(Date createDate) {
        this.createDate = createDate;
        return this;
    }

    //类型//采购退货出库，销售出库，其他出库，//采购入库，销售退货入库，库存调整
    public enum OrderType {
        OUT_SALES, OUT_OTHER, OUT_PROCUREMENT_RETURNS,
        IN_PURCHASE, IN_RETURN
    }
}
